<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    
    <ui:composition template="../../../home.xhtml" >
        <ui:define name="content">
           
            <h:form >
                    <p:dataTable id="dtlogin" var="agent" value="#{loginController.listAgent}" styleClass="employeeTable"
                                 rows="10" paginator="true"
                                     >
                         <p:column>
                            <f:facet name="header">
                                <h:outputText value="ID" />
                            </f:facet>
<!--                             <h:inputText value="#{agent.idAgents}" size="5" rendered="#{agent.editable}" />-->
                             <h:outputText value="#{agent.idAgents}" rendered="#{not agent.editable}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header"> 
                                <h:outputText value="User Name"/>
                            </f:facet>
                            <h:inputText value="#{agent.userNameAgents}" size="10" rendered="#{agent.editable}"/>
                            <h:outputText value="#{agent.userNameAgents}" rendered="#{not agent.editable}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header"> 
                                <h:outputText value="Pass User" />
                            </f:facet>
                            <h:inputText value="#{agent.passAgents}" size="10" rendered="#{agent.editable}"/>
                            <h:outputText value="#{agent.passAgents}" rendered="#{not agent.editable}"/>
                        </p:column>
                         <p:column>
                            <f:facet name="header">
                                <h:outputText value="Full Name"/>  
                            </f:facet>
                             <h:inputText value="#{agent.nameAgents}" size="10" rendered="#{agent.editable}"/>
                            <h:outputText value="#{agent.nameAgents}" rendered="#{not agent.editable}"/>
                        </p:column>
                         <p:column>
                            <f:facet name="header"> 
                                <h:outputText value="Group" />
                            </f:facet>
                             <h:inputText value="#{agent.group.nameGroup}" size="10" rendered="#{agent.editable}"/>
                             <h:outputText value="#{agent.group.nameGroup}" rendered="#{not agent.editable}"/>
                        </p:column>
                         <p:column>
                            <f:facet name="header"> 
                                <h:outputText value="Adress"/>
                            </f:facet>
                             <h:inputText value="#{agent.addressAgents}" size="10" rendered="#{agent.editable}"/>
                             <h:outputText value="#{agent.addressAgents}" rendered="#{not agent.editable}"/>
                        </p:column>
                         <p:column>
                            <f:facet name="header">
                                <h:outputText value="Email"/>   
                            </f:facet>
                             <h:inputText value="#{agent.emailAgents}" size="10" rendered="#{agent.editable}"/>
                             <h:outputText value="#{agent.emailAgents}" rendered="#{not agent.editable}"/>
                        </p:column>
                         <p:column>
                            <f:facet name="header"> 
                                <h:outputText value="Mobile"/>  
                            </f:facet>
                             <h:inputText value="#{agent.mobileAgents}" size="10" rendered="#{agent.editable}"/>
                             <h:outputText value="#{agent.mobileAgents}" rendered="#{not agent.editable}"/>
                        </p:column>
                        <p:column >
                            <p:commandLink value="Delete" action="#{loginController.suprimer(agent)}"  update="dtlogin" ajax="true"  >
                               
                            </p:commandLink>
                        </p:column>
                        <p:column>
                            <h:commandLink value="Edit" action="#{loginController.editAction(agent)}" rendered="#{not agent.editable}" />
                        </p:column>
                        <p:column>
                            <h:commandLink value="Changes" action="#{loginController.tableUpdateUser(agent)}"  />
                        </p:column>
                    </p:dataTable>
                
                
             </h:form>  
           
        </ui:define>
    </ui:composition>
        
</html>

